﻿using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace LuoYi.Admin.Entities;

/// <summary>
/// 系统访问记录
/// </summary>
[Table("sys_logininfor")]
[Index("LoginTime", Name = "idx_sys_logininfor_lt")]
[Index("Status", Name = "idx_sys_logininfor_s")]
public class SysLogininfor: IEntity
{
    /// <summary>
    /// 访问ID
    /// </summary>
    [Key]
    [Column("info_id", TypeName = "bigint(20)")]
    public long InfoId { get; set; }

    /// <summary>
    /// 用户账号
    /// </summary>
    [Column("user_name")]
    [StringLength(50)]
    public string? UserName { get; set; }

    /// <summary>
    /// 登录IP地址
    /// </summary>
    [Column("ipaddr")]
    [StringLength(128)]
    public string? Ipaddr { get; set; }

    /// <summary>
    /// 登录地点
    /// </summary>
    [Column("login_location")]
    [StringLength(255)]
    public string? LoginLocation { get; set; }

    /// <summary>
    /// 浏览器类型
    /// </summary>
    [Column("browser")]
    [StringLength(50)]
    public string? Browser { get; set; }

    /// <summary>
    /// 操作系统
    /// </summary>
    [Column("os")]
    [StringLength(50)]
    public string? Os { get; set; }

    /// <summary>
    /// 登录状态（0成功 1失败）
    /// </summary>
    [Column("status")]
    [StringLength(1)]
    public string? Status { get; set; }

    /// <summary>
    /// 提示消息
    /// </summary>
    [Column("msg")]
    [StringLength(255)]
    public string? Msg { get; set; }

    /// <summary>
    /// 访问时间
    /// </summary>
    [Column("login_time", TypeName = "datetime")]
    public DateTime? LoginTime { get; set; }
}
